﻿using UnityEngine;

public class PlayerCoin : MonoBehaviour
{
    private int coin = 0;

    private void Start()
    {
        RxEventBus.Publish(new PlayerCoinChangeEvent(coin));
    }

    public void AddCoin(int amount)
    {
        coin += amount;
        Debug.Log("Player got " + amount + " coins");
        RxEventBus.Publish(new PlayerCoinChangeEvent(coin));
    }

    private void OnEnable()
    {
    }

    private void OnDisable()
    {
    }
}